home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / TGCBOR20.ARJ / INTROPAK.COM / EXEVENT2.C < prev    next >
C/C++ Source or Header  |  1991-04-06  |  3KB  |  109 lines

  1.  
  2. #include "teglsys.h"
  3.  
  4.   optionmptr   om1, om2;
  5.  
  6.  
  7.  
  8. unsigned getmssense(imagestkptr  fs, msclickptr   ms)
  9.   {
  10.     /* setmousesense(fs->x,fs->y); */
  11.     return 1;
  12.   }
  13.  
  14.  
  15.  
  16. unsigned infooption(imagestkptr  fs, msclickptr   ms)
  17.    {
  18.       unsigned         x, y, x1, y1;
  19.       imagestkptr  ifs;
  20.       unsigned         ax, ay, ax1, ay1;
  21.       unsigned         option;
  22.  
  23.       hidemouse();
  24.  
  25.       x = 200;
  26.       y = 120;
  27.       x1 = x + 340;
  28.       y1 = y + 100;
  29.  
  30.       ax = ms->ms.x + fs->x;
  31.       ay = ms->ms.y + fs->y;
  32.       ax1 = ms->ms.x1 + fs->x;
  33.       ay1 = ms->ms.y1 + fs->y;
  34.  
  35.         /* -- push image creates the frame and saves the background image  */
  36.  
  37.       pushimage(x,y,x1,y1);
  38.       ifs = stackptr;   /* -- stackptr has the most recent frame  */
  39.  
  40.         /* -- ziptobox creates a xor box that moves from one location to  */
  41.         /* -- another and changes size. The msclickptr passed to the event  */
  42.         /* -- has the coordinates of the mouse click area that has activated  */
  43.         /* -- this event.  */
  44.  
  45.       ziptobox(ax,ay,ax1,ay1,x,y,x1,y1);
  46.  
  47.       setcolor(WHITE);
  48.       shadowbox(x,y,x1,y1);
  49.  
  50.       setcolor(BLACK);
  51.       setteglfont(font14);
  52.       outtegltextxy(x + 5,y + 5,"TEGL Windows Toolkit II");
  53.       outtegltextxy(x + 5,y + 5 + teglcharheight(),"Jan. 1, 1990, Program Written by Richard Tom");
  54.  
  55.         /* -- next put up an ok button and associated a mouse click with  */
  56.         /* -- it. No real event is called we just want to detect the mouse  */
  57.         /* -- click to know when to close the window.  */
  58.  
  59.       putpict(x + 280,y + 75,imageOK,BLACK);
  60.       definemouseclickarea(ifs,280,75,280 + 35,75 + 12,TRUE,nilunitproc,MSCLICK);
  61.       setmouseposition(x + 290,y + 85);
  62.       showmouse();
  63.  
  64.         /* -- wait until mouse action on this frame  */
  65.       while (checkformouseselect(ifs) == NULL) ;
  66.         /* -- then dispose of the frame and zip back to the orginal postion  */
  67.         /* -- on the screen.  */
  68.  
  69.       hidemouse();
  70.       dropstackimage(ifs);
  71.       zipfrombox(ax,ay,ax1,ay1,ifs->x,ifs->y,ifs->x1,ifs->y1);
  72.       showmouse();
  73.  
  74.       return 1;
  75.    }
  76.  
  77.  
  78.  
  79.  
  80. void main(void)
  81. {
  82.  
  83.  
  84.  
  85.    easytegl();
  86.  
  87.  
  88.    om1 = createoptionmenu(font14);
  89.    defineoptions(om1," ~O~pen ",TRUE,nilunitproc);
  90.    defineoptions(om1," ~I~nfo...",TRUE,infooption);
  91.    defineoptions(om1,"-",FALSE,nilunitproc);
  92.    defineoptions(om1," ~Q~uit ",TRUE,quit);
  93.  
  94.    om2 = createoptionmenu(font14);
  95.    defineoptions(om2," ~M~emory ",TRUE,nilunitproc /*showcoordinates*/);
  96.    defineoptions(om2," ~M~ouse Sensitivity ",TRUE,getmssense);
  97.  
  98.    createbarmenu(0,0,getmaxx());
  99.    outbaroption(" ~F~ile ",om1);
  100.    outbaroption(" ~U~tility ",om2);
  101.  
  102.      /*  -- control is then passed to the supervisor  */
  103.  
  104.    teglsupervisor();
  105. }
  106.  
  107.  
  108.  
  109.